package com.example.beautymakeup.dao;


import com.example.beautymakeup.pojo.Hot;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface HotDao {
    @Select("select * from hot where status = 0;")
    List<Hot> get();

    @Select("select * from hot limit #{page},#{size};")
    List<Hot> getAll(@Param("page") int page, @Param("size") int size);

    @Select("select * from hot;")
    List<Hot> getAllHot();

    @Update("update hot set title = #{title},image = #{image} where uid = #{uid};")
    int update(Hot hot);

    @Insert("insert into hot(title,image) values (#{title},#{image});")
    int add(Hot hot);

    @Select("select count(*) from hot where status = 0;")
    int getCount();

    @Select("select count(*) from hot;")
    int getAllCount();

    @Update("update hot set status = #{status} where uid = #{uid};")
    int ban(Hot hot);

    @Delete("delete from hot where uid = #{uid};")
    int delete(Hot hot);
}
